Function: firstChild(domElementOrStringMarkupOrCSSSelector, functionConfirm(domElement)) Shorthand: first(domElementOrStringMarkupOrCSSSelector, functionConfirm(domElement)) Description: Returns the first child element. Returns: domElement, or $A object if chained. Note: When the second parameter is undefined, firstChild() returns the first child DOM element. When the second parameter is set to a function however, it must return true in order for the current node to be returned. This exists for cases when specific criteria are needed, such as a matching tag name or element type. Example: // Return the first child DOM element. var myElement = $A.firstChild(domElement); // Return the first child DOM element, but only when specific criteria is confirmed. var myElement = $A.firstChild(domElement, function(node) { if (node.nodeName.toLowerCase() === "h2") return true; }); // Or the same using chaining // Return the first child DOM element. var myChain = $A(domElement).firstChild(); // Return the first child DOM element, but only when specific criteria is confirmed. var myChain = $A(domElement).firstChild(function(node) { if (node.nodeName.toLowerCase() === "h2") return true; }); // To return the modified element within a chain, use the "return()" method. var myElement = myChain.return();